<script setup lang="ts">
// 需求：数据点击+1
import { addEvent } from '@/composable/playground'
import { useUserStore } from '@/stores'
import { storeToRefs } from 'pinia'
const userStore = useUserStore()
const { testNum } = storeToRefs(userStore)

const { num, add } = addEvent()
</script>

<template>
  <div class="play-page">
    <h3>{{ num }}</h3>
    <button @click="add">点击++</button>

    <hr />
    <h3>{{ testNum }}</h3>
    <button @click="userStore.setTestNum">点击++</button>
  </div>
</template>

<style lang="scss" scoped></style>
